import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { PartialType } from '@nestjs/swagger';
import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';

export class Platformsort_Create_Dto {
  @IsString()
  @IsNotEmpty()
  @ApiProperty({ description: '商品分类名称' })
  platformsortName: string;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '选中图片' })
  activeImg?: string;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '非选中图片' })
  rAactiveImg?: string;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  @ApiProperty({ default: 0, description: '商品分类排序' })
  platformsortSort?: number;
}

export class Platformsort_Find_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  size?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  page?: number;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '商品分类名称' })
  platformsortName?: string;
}

export class Platformsort_Update_Dto extends PartialType(Platformsort_Create_Dto) {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  id: number;
}
